<template>
  <div class="page-container">
    <cm-table
      pkName="reportDate"
      :filters="filters"
      :filterFields="filterFields"
      :columns="columns"
    />
  </div>
</template>

<script setup>
import { ref } from 'vue';

const options = [
  {key: '1', value: '按天'},
  {key: '3', value: '按月'},
  {key: '4', value: '按年'},
];
const filters = ref({
  startDate: '',
  endDate: '',
  type: '',
});
const filterFields = ref([
  {prop: "startDate", label: "开始时间", type: 'date'},
  {prop: "endDate", label: "结束时间", type: 'date'},
  {prop: "reportType", label: "统计类型", type: 'select', options: options},
]);
const columns = ref([
  {prop: "reportDate", label: "统计时间", minWidth: 120},
  {prop: "tradeAmount", label: "成交额", minWidth: 120, type: 'number', point: 2},
  {prop: "commission", label: "手续费", minWidth: 120, type: 'number', point: 2},
  {prop: "profitMoney", label: "盈亏金额", minWidth: 120, type: 'number', point: 2},
]);
</script>